
import unittest

from pages.login_page import LoginPage
from tools.tools import chrome


class BaseTestCase(unittest.TestCase):
    # 将用例类中共有的setUp()和tearDown()提取出来
    def setUp(self):
        self.driver = chrome()
        self.driver.implicitly_wait(30)

    def tearDown(self):
        self.driver.quit()

#实例化登录页面，提供登录功能

    def login(self, username, password):
        login_page = LoginPage(self.driver)
        login_page.open()
        login_page.login(username, password)
